<?php
/* @var $this ProfileController 
 * @var $model Resident
 * @var $form CActiveForm
 * */
if(!Yii::app()->user->isGuest && isset(Yii::app()->user->userModel)){
	$matric_no = $model->matric_no;
	$user_model = $model;
	$cca_count = sizeof($user_model->ccaResidents);
}
$this->breadcrumbs=array(
	'Profile'=>array('/profile'),
	'Edit',
);
?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'resident-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $model->name;?>
		<?php echo $form->hiddenField($model,'name'); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'matric_no'); ?>
		<?php echo $model->matric_no;?>
		<?php echo $form->hiddenField($model,'matric_no'); ?>
		<?php echo $form->error($model,'matric_no'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'gender'); ?>
		<?php echo $model->gender;?>
		<?php echo $form->hiddenField($model,'gender'); ?>
		<?php echo $form->error($model,'gender'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'classification'); ?>
		<?php echo $model->classification;?>
		<?php echo $form->hiddenField($model,'classification'); ?>
		<?php echo $form->error($model,'classification'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'nationality'); ?>
		<?php echo $model->nationality;?>
		<?php echo $form->hiddenFIeld($model,'nationality'); ?>
		<?php echo $form->error($model,'nationality'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'room'); ?>
		<?php echo $model->room;?>
		<?php echo $form->hiddenField($model,'room'); ?>
		<?php echo $form->error($model,'room'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email_school'); ?>
		<?php echo $model->email_school;?>
		<?php echo $form->hiddenField($model,'email_school'); ?>
		<?php echo $form->error($model,'email_school'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>125)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'phone'); ?>
		<?php echo $form->textField($model,'phone',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'phone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'faculty'); ?>
		<?php echo $model->faculty;?>
		<?php echo $form->hiddenField($model,'faculty'); ?>
		<?php echo $form->error($model,'faculty'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'active'); ?>
		<?php echo $model->active;?>
		<?php echo $form->hiddenField($model,'active'); ?>
		<?php echo $form->error($model,'active'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->